/**
 * 
 */

/**
 * @author Michael Fildestine ID:309161594
 *
 */
public class BasicStar {
	
	
	public BasicStar(){
	}
	
	public void draw(){
		int height =   Painter.getFrameHeight()/2;
		int width = Painter.getFrameWidth()/2;
		int maxRadius = Math.min(height, width)/2;
		int radius = maxRadius/4;
		Pixel p = new Pixel(height, width);
		Painter.setColor("blue");
		draw(p, radius);
	}
	
	public void draw(Pixel p, int radius) {
		double theta = 0;										//the angle theta we use to calculate the x,y value of the tips of the star.							
		double xCoord = 0;
		double yCoord = 0;
		int counter = 0;
						
		while(counter < 6){								//	we draw 6 lines with 60 degree interval.
			xCoord = p.getX() + Math.cos(theta)*radius;
			yCoord = p.getY() + Math.sin(theta)*radius;
			Painter.drawLine(p.getX(), p.getY(),(int)xCoord ,(int)yCoord);
		theta = theta + 2*(Math.PI/6);
		counter = counter + 1;
	
		}
		
		
	}
}